<#include "/common/commoncss.ftl">
<link rel="stylesheet" href="css/common/checkbox.css"/>
<link rel="stylesheet" href="css/role/roleset.css"/>

<script>
    $(function () {

        $(".widths").each(
            function () {
                var $val = $(this).text();

                if ($val == "#") {
                    var $this = $(this).parents("tr");
                    $this.css("background-color",
                        "rgba(255, 235, 59, 0.19)");
                    $this.hover(function () {
                        $this.css("background-color",
                            "rgba(158, 158, 158, 0.09)");
                    }, function () {
                        $this.css("background-color",
                            "rgba(255, 235, 59, 0.19)");
                    })
                }
            })

        $(".menus").each(function () {
            var $val = $(this).text();
            if ($val == "菜单") {
                $(this).css("color", "#4caf50");
            } else {
                $(this).css("color", "#9e9e9e");
            }
        })

        $("[name=isShow]:checkbox").click(function () {
            var $roleid =
            ${role.roleId}

            var menu;
            var content;
            if (this.checked) {
                menu = $(this).parents("td").siblings(".menuid").text();
                content = 1
            } else {
                menu = $(this).parents("td").siblings(".menuid").text();
                content = 0
            }
            console.log(menu);
            console.log(content);
            $.post("powerss", {roleId: $roleid, isShow: content, menuId: menu}, function (data) {

            })
        })

    });

</script>
<style>
    .table > tbody > tr > td {
        border-top: 1px solid rgba(245, 245, 220, 0.29);
    }
</style>
</head>

<body style="background-color: #ecf0f5;">

<div class="">
    <div class=" ">
        <div class="row">
            <div class="col-md-2">
                <h1 style="font-size: 24px; margin: 0;" class="">${(role.roleName)!''}</h1>
            </div>
            <div class="col-md-10 text-right">
                <a href="##"><span class="glyphicon glyphicon-home"></span> 首页</a>
                > <a disabled="disabled">${(role.roleName)!''}</a>
            </div>
        </div>
        <div class="row" style="padding-top: 15px;">
            <div class="col-md-12">
                <div class="bgc-w box box-primary">
                    <!--盒子头-->
                    <div class="box-header">
                        <a class="btn btn-sm label-back"
                           href="javascript:history.back();"> <span
                                    class="glyphicon glyphicon-chevron-left"></span> 返回
                        </a>
                    </div>
                    <!--盒子身体-->
                    <div class="col-md-12 thistable">
                        <!--id="container"-->
                        <#include "/role/rolesetable.ftl">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

